#!/bin/bash

srcfile="libvirt-1.2.14.tar.gz"

if [ $# -eq 0 ];then
  echo "Usage: $0 -ba|-bp"
  exit
fi
HOME=/tmp/`whoami`
builddir=${HOME}/rpmbuild
mkdir -p ${builddir}/SPECS/
mkdir -p ${builddir}/SOURCES/
mkdir -p ${builddir}/RPMS
cp $srcfile ${builddir}/SOURCES/

#cp *.patch ${builddir}/SOURCES/
cp libvirt.spec ${builddir}/SPECS/
cd ${builddir}/SPECS && rpmbuild ${1} libvirt.spec
